<?php


namespace App\Transformers\System;


use App\Models\SystemStoreStaff;
use League\Fractal\TransformerAbstract;

class SystemStoreStaffTransformer extends TransformerAbstract
{
    public function transform(SystemStoreStaff $data)
    {
        return [
            'id' => $data->id,
            'user_id' => $data->user_id ?? '',
            'store_id' => $data->store_id ?? '',
            'avatar' => $data->avatar ?? '',
            'staff_name' => $data->staff_name ?? '',
            'phone' => $data->phone ?? '',
            'user'=> $data->user ?? '',
            'store'=>$data->store ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
